import request from '@/utils/request'

export function loadDataUrl() {
  return 'workflow-service/api/workflowMng/findTasksByUserAccount'
}
export function approvedCCLoadDataUrl() {
  return 'workflow-service/api/workflowMng/findApprovedCCTasksByUserAccount'
}

export function approvedLoadDataUrl() {
  return 'workflow-service/api/workflowMng/findApprovedTasksByUserAccount'
}

export function submitLoadDataUrl() {
  return 'workflow-service/api/workflowMng/findSubmitTasksByUserAccount'
}

export function approve(data) {
  return request({
    url: 'workflow-service/api/workflowMng/approve',
    method: 'post',
    data
  })
}

export function getApproveTaskNum() {
  return request({
    url: 'workflow-service/api/workflowMng/getApproveTaskNum',
    method: 'get'
  })
}

export function getApproveHistoryByInfo(processInstanceId, businessKey) {
  return request({
    url: 'workflow-service/api/workflowMng/getApproveHistoryByInfo',
    method: 'get',
    params: {
      processInstanceId: processInstanceId,
      businessKey: businessKey
    }
  })
}
